package com.srit.migration.business.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

import com.srit.base.bean.Page;
import com.srit.base.dao.SqlMapDao;
import com.srit.migration.business.bean.DbTable;
import com.srit.migration.business.dao.DbTableDao;

/**
 * @author guan
 * @by daoImpl.tem
 * 
 */
 @Service
public class DbTableDaoImpl implements DbTableDao {
	@Autowired(required = true)
	private SqlMapDao sqlMapDao;

	@Override
	public void save(DbTable dbTable) {
		sqlMapDao.save("DbTable.save", dbTable);
	}

	@Override
	public void update(DbTable dbTable) {
		sqlMapDao.update("DbTable.save", dbTable);
	}

	@Override
	public DbTable getById(DbTable dbTable) {
		return (DbTable) sqlMapDao.getById("DbTable.getById", dbTable.getId());
	}

	@Override
	public void delete(DbTable dbTable) {
		sqlMapDao.delete("DbTable.delete", dbTable);
	}

	@Override
	public void page(Page page) {
		sqlMapDao.queryForObject("DbTable.page", page);
	}
	
	@Override
	public void batchSave(List<DbTable> dbTableList) {
		sqlMapDao.batchSave("DbTable.batchSave", dbTableList);

	}

	@Override
	public List list(Page page) {
		return sqlMapDao.queryForList("DbTable.list", page);

	}

}
